-
Notifications
You must be signed in to change notification settings - Fork 69
Support for explicit public API markers #116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If the added properties are used, all unmatched declarations will be excluded from the API check. If properties for both ignored and explicit markers are set, filtering of ignored declarations will happen after filtering of declarations not explicitly marked as public.
qwwdfsad
reviewed
Feb 21, 2023
.map { it.flattenNonPublicBases() } | ||
.filterNot { it.isNotUsedWhenEmpty && it.memberSignatures.isEmpty() } | ||
} | ||
|
||
@ExternalApi | ||
public fun List<ClassBinarySignature>.retainExplicitlyIncludedIfDeclared( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please elaborate on whether you do plan to use retainExplicitlyIncludedIfDeclared
exclusively or also plugin DSL to use the API?
qwwdfsad
approved these changes
Mar 3, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nicely done!
qwwdfsad
approved these changes
Mar 3, 2023
github-merge-queue bot
referenced
this pull request
in elide-dev/elide
Jul 23, 2023
[](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [org.jetbrains.kotlinx.binary-compatibility-validator](https://togithub.com/Kotlin/binary-compatibility-validator) | `0.12.1` -> `0.13.2` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | | [org.jetbrains.kotlinx:binary-compatibility-validator](https://togithub.com/Kotlin/binary-compatibility-validator) | `0.12.1` -> `0.13.2` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### ⚠ Dependency Lookup Warnings ⚠ Warnings were logged while processing this repo. Please check the Dependency Dashboard for more information. --- ### Release Notes <details> <summary>Kotlin/binary-compatibility-validator (org.jetbrains.kotlinx.binary-compatibility-validator)</summary> ### [`v0.13.2`](https://togithub.com/Kotlin/binary-compatibility-validator/releases/tag/0.13.2) [Compare Source](https://togithub.com/Kotlin/binary-compatibility-validator/compare/0.13.1...0.13.2) - `kotlinx-metadata` is updated to 0.6.2 with the support of LV 2.0 ### [`v0.13.1`](https://togithub.com/Kotlin/binary-compatibility-validator/releases/tag/0.13.1) [Compare Source](https://togithub.com/Kotlin/binary-compatibility-validator/compare/0.13.0...0.13.1) - Added support for explicit public API markers ([https://github.com/Kotlin/binary-compatibility-validator/pull/116](https://togithub.com/Kotlin/binary-compatibility-validator/pull/116)) ### [`v0.13.0`](https://togithub.com/Kotlin/binary-compatibility-validator/releases/tag/0.13.0) [Compare Source](https://togithub.com/Kotlin/binary-compatibility-validator/compare/0.12.1...0.13.0) - Kotlin is updated to 1.8.10 - kotlinx-metadata is updated to 0.6.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/elide-dev/elide). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4xMS4wIiwidXBkYXRlZEluVmVyIjoiMzYuMTEuMCIsInRhcmdldEJyYW5jaCI6InYzIn0=-->
shanshin
pushed a commit
to JetBrains/kotlin
that referenced
this pull request
Oct 28, 2024
* Add support for defining public declarations explicitly If the added properties are used, all unmatched declarations will be excluded from the API check. If properties for both ignored and explicit markers are set, filtering of ignored declarations will happen after filtering of declarations not explicitly marked as public. * Support validation of non-main source sets for kotlin-jvm projects Pull request Kotlin/binary-compatibility-validator#116
shanshin
pushed a commit
to JetBrains/kotlin
that referenced
this pull request
Dec 3, 2024
* Add support for defining public declarations explicitly If the added properties are used, all unmatched declarations will be excluded from the API check. If properties for both ignored and explicit markers are set, filtering of ignored declarations will happen after filtering of declarations not explicitly marked as public. * Support validation of non-main source sets for kotlin-jvm projects Pull request Kotlin/binary-compatibility-validator#116
shanshin
pushed a commit
to JetBrains/kotlin
that referenced
this pull request
Dec 13, 2024
* Add support for defining public declarations explicitly If the added properties are used, all unmatched declarations will be excluded from the API check. If properties for both ignored and explicit markers are set, filtering of ignored declarations will happen after filtering of declarations not explicitly marked as public. * Support validation of non-main source sets for kotlin-jvm projects Pull request Kotlin/binary-compatibility-validator#116
shanshin
pushed a commit
to JetBrains/kotlin
that referenced
this pull request
Dec 23, 2024
* Add support for defining public declarations explicitly If the added properties are used, all unmatched declarations will be excluded from the API check. If properties for both ignored and explicit markers are set, filtering of ignored declarations will happen after filtering of declarations not explicitly marked as public. * Support validation of non-main source sets for kotlin-jvm projects Pull request Kotlin/binary-compatibility-validator#116 Moved from Kotlin/binary-compatibility-validator@5d08f51
KotlinBuild
pushed a commit
to JetBrains/kotlin
that referenced
this pull request
Jan 3, 2025
* Add support for defining public declarations explicitly If the added properties are used, all unmatched declarations will be excluded from the API check. If properties for both ignored and explicit markers are set, filtering of ignored declarations will happen after filtering of declarations not explicitly marked as public. * Support validation of non-main source sets for kotlin-jvm projects Pull request Kotlin/binary-compatibility-validator#116 Moved from Kotlin/binary-compatibility-validator@5d08f51
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The pull request introduces support for two new features:
ignoredProjects
,ignoredPackages
andnonPublicMarkers
allow excluding some parts of API from compatibility validation and checking the rest. NewpublicMarkers
,publicPackages
andpublicClasses
do the opposite: if any of them is used, only explicitly marked declarations are considered for validation, all the rest are excluded.main
source set can be validated.Motivation
In
kotlin.git
we would like to maintain binary compatibility only for a few parts of the:kotlin-gradle-plugin
project related to the External Kotlin Target API, that will be used by third parties when implemented. The declarations are either annotated, or belong to a specific package. Use of the existing API of validator to exclude everything else is not very convenient and would complicate maintenance of the project in the future. Because, for instance, adding new packages would require build script changes, as they have to be excluded from validation. Parts of the relevant code belong to a custom Gradle source set, so without the second introduced feature validation is not possible.Implementation notes
public*
properties are used in a build script, which shouldn't affect any users that don't touch the propertieskotlin-jvm
Gradle plugin to minimize the changes